var e = getApp();

module.exports = Behavior({
    data: {},
    methods: {
        checktoInvite: function(i, a) {
            1 !== i.real_name_auth_is_open ? 0 !== i.is_bind_mobile ? this.bindMobile(i.is_bind_mobile, e.globalData.pathData, a) : 1 === i.is_login ? 1 !== i.is_invite ? 1 === i.invite_page ? wx.redirectTo({
                url: "/packageC/member/visit/Inviter/Inviter"
            }) : this.gotourl(a) : void 0 !== i.invite_mobile && 1 !== i.invite_mobile && 1 === i.invite_page ? wx.redirectTo({
                url: "/packageC/member/visit/Inviter/Inviter"
            }) : this.gotourl(a) : this.gotourl(a) : 1 !== i.is_auth ? this.bind_real_name(i.real_name_auth_scene, e.globalData.pathData, a) : this.gotourl(a);
        },
        bindMobile: function(e, i, a) {
            1 == e ? wx.reLaunch({
                url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=1"
            }) : 2 == e && i.indexOf("index_v2/index_v2") > 0 ? wx.reLaunch({
                url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=2"
            }) : 3 == e && i.indexOf("detail_v2/detail_v2") > 0 ? wx.reLaunch({
                url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=1"
            }) : 4 == e && i.indexOf("extension/extension") > 0 ? wx.reLaunch({
                url: "/packageA/member/editmobile/editmobile?logintype=1&fromApp=4"
            }) : this.gotourl(a);
        },
        bind_real_name: function(e, i, a) {
            "packageH/signPage/personBank/personBank" !== i && wx.setStorageSync("real_name_redirect", i), 
            e.indexOf("1") > -1 || e.indexOf("2") > -1 && "packageA/member/withdrawal/withdrawal" == i || e.indexOf("3") > -1 && ("packageC/video_goods/videoAgreement/videoAgreement" == i || "packageC/video_goods/releaseVideo/releaseVideo" == i) || e.indexOf("4") > -1 && "packageC/micro_communities/microRelease/microRelease" == i || e.indexOf("5") > -1 && "packageG/pages/member/extension/extension" == i ? wx.reLaunch({
                url: "/packageH/signPage/personBank/personBank?from=bindRealName"
            }) : this.gotourl(a);
        },
        gotourl: function(e) {
            try {
                if (this.data.yzredirect && "member" !== e) if (this.data.yzredirect.indexOf("login/login") > 0) this.gomember(); else if (this.data.yzredirect.indexOf("pages/live-player-plugin") > 0) {
                    var i = getCurrentPages(), a = i[i.length - 2];
                    a.onLoad(a.options), wx.navigateBack({
                        delta: 1,
                        fail: function(e) {
                            wx.reLaunch({
                                url: "/packageG/member_v2/member_v2"
                            });
                        }
                    });
                } else wx.reLaunch({
                    url: "/" + this.data.yzredirect,
                    fail: function(e) {
                        wx.reLaunch({
                            url: "/packageG/member_v2/member_v2"
                        });
                    }
                }); else this.gomember();
            } catch (e) {
                wx.reLaunch({
                    url: "/packageG/index/index"
                });
            }
        },
        gomember: function() {
            wx.reLaunch({
                url: "/packageG/member_v2/member_v2"
            });
        }
    }
});